package com.atguigu.boot;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Service;

import javax.jms.JMSException;
import javax.jms.TextMessage;

@Service
public class Topic_Consumer {
    @JmsListener(destination = "${myTopic}")
    public void receive(TextMessage textMessage)throws JMSException{
        System.out.println(textMessage.getText());
    }
}
